package com.sky.mapper;

import com.sky.entity.Setmeal;
import com.sky.vo.SetmealVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface SetmealMapper {
    // 动态查询套餐
    List<Setmeal> getList(Setmeal setmeal);


    //分页查询
    List<SetmealVO> getSetmealList(String name, Integer status, Integer categoryId);

    //新增套餐
    void saveSetmeal(Setmeal setmeal);

    //根据套餐id查询套餐信息
    @Select("select * from setmeal where id = #{id}")
    Setmeal getById(String id);

    //修改套餐数据
    void update(Setmeal setmeal);

    //批量删除套餐
    void delete(List<Long> ids);

    @Update("update setmeal set status = #{status} where id = #{id}")
    void setStatus(Integer status, Long id);
}
